package com.mobartisan.workinglunch.network.service;


import com.mobartisan.workinglunch.bean.ImageBean;
import com.mobartisan.workinglunch.network.BaseApiService;
import com.mobartisan.workinglunch.network.response.SnakeResponse;
import com.mobartisan.workinglunch.util.EncodeUtils;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import rx.Observable;

/**
 * Created by dell on 2016/10/3.
 */
public class SnakeServiceImpl extends BaseApiService {
    private static String TAG = SnakeService.class.getSimpleName();

    private interface SnakeService {
        /**
         * 上传图片
         *
         * @param
         * @param map
         * @return
         */
        @Multipart
        @POST("plugins/nari.mip.plugin.mrr/rest/1/rpc/upload")
        Observable<SnakeResponse<ImageBean>> uploadImage(@PartMap HashMap<String, RequestBody> map);

        //        /**
//         * 上传图片
//         * @param jsessionid
//         * @param map
//         * @return
//         */
//        @Multipart
//        @POST("plugins/{jsessionid}")
//        Observable<SnakeResponse<UpImageReturnInfo>> uploadImage(@Path("jsessionid") String jsessionid, @PartMap HashMap<String, RequestBody> map);

    }


    protected static SnakeService service = getService(SnakeService.class);
    /**
     * 上传照片接口
     *
     * @return
     */
    public static Observable<SnakeResponse<ImageBean>> uploadImage(HashMap<String, RequestBody> map) {
        return service.uploadImage(map);
    }
}
